package com.corpgovernment.organization.entity.db;

import com.corpgovernment.common.annotation.OperateLogFieldDesc;
import com.corpgovernment.common.entity.db.BaseEntity;
import com.corpgovernment.common.handler.Sm4TypeHandler;
import com.corpgovernment.organization.enumm.CardCodeEnum;
import com.corpgovernment.organization.enumm.PassportEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.*;
import java.util.Date;


/**
 * 用户证件信息表
 *
 * @author qkdong
 **/
@EqualsAndHashCode(callSuper = true)
@SuppressWarnings("serial")
@Data
@Table(name = "mb_org_user_idcard")
public class MbOrgUserIdcard extends BaseEntity {

    /**
     * 主键
     **/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @OperateLogFieldDesc(value = "主键")
    private Long id;

    /**
     * 卡类型 1：身份证  2：护照 3：学生证 4：军人证 7：回乡证  8:台胞证 10：港澳通行证   21：旅行证   22：台湾通行证 28：外国人永久居留身份证  32：港澳台居民居住证  99：其他
     **/
    @Column(name = "card_type")
    @OperateLogFieldDesc(value = "卡类型", type = CardCodeEnum.class)
    private Integer cardType;

    /**
     * 卡号
     **/
    @Column(name = "card_no")
    @OperateLogFieldDesc(value = "卡号")
	@ColumnType(typeHandler = Sm4TypeHandler.class)
    private String cardNo;

    /**
     * 有效截止日期
     **/
    @Column(name = "time_limit")
    @OperateLogFieldDesc(value = "主键")
    private java.util.Date timeLimit;

    /**
     * 护照类型  P:因私   I:因公   D:外交
     **/
    @Column(name = "passport_type")
    @OperateLogFieldDesc(value = "护照类型", type = PassportEnum.class)
    private String passportType;

    /**
     * 签发地
     **/
    @Column(name = "issue_at")
    @OperateLogFieldDesc(value = "签发地")
    private String issueAt;

    /**
     * 员工uid
     **/
    @Column(name = "employee_uid")
    @OperateLogFieldDesc(value = "员工uid")
    private String employeeUid;

    /**
     * 非员工id
     */
    @Column(name = "non_employee_id")
    @OperateLogFieldDesc(value = "非员工id")
    private Long nonEmployeeId;

    /**
     * 删除时间，1970-01-01 08:00:00.000代表未删除
     **/
    @Column(name = "delete_time")
    private Date deleteTime;

    /**
     * 证件签发国
     */
    @Column(name = "place_of_issue")
    @OperateLogFieldDesc(value = "证件签发国")
    private String placeOfIssue;

}
